<?php

$date = $_GET["date"];
$date = "'".$date."'";
$valOne = $_GET['valOne'];
$valTwo = $_GET['valTwo'];
$valThree = $_GET['valThree'];
$values = array($valOne, $valTwo, $valThree);
if($values != null)
{
$numValues = count($values);
$jsonArray = "'0': '".$valOne."','1': '".$valTwo."','2': '".$valThree."'";
$jsonArray = $date.':{' . $jsonArray;
$jsonArray = $jsonArray . "}";
$old = file_get_contents("TOD.json");
$oldLength = strlen($old);
$putAt = $oldLength-1;
$new = substr_replace($old, ", ".$jsonArray." }", $putAt);
file_put_contents("TOD.json", $new);
}
else
{
die("Please insert values!");
}

?>		